/**
 * @file contests/cf1698/a/main.cpp
 * @brief
 * @see
 * @author Ruiming Guo (guoruiming@stu.scu.edu.cn)
 * @copyright 2022
 * @date 2022/7/10 15:03:11
 **/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main() {
  // High rating and good luck!
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    bool flag = false;

    while (n--) {
      int a;
      cin >> a;
      if (flag == false) {
        cout << a << endl;
        flag = true;
      }
    }
  }
  return 0;
}
